// import { prepayJsapi } from "../../utils/pay/wxpay-partner";

import { profitAdd } from "../../utils/pay/wxpay-partner";
import {
  parterProfitSharing,
  partnerAddReceiver,
} from "../../utils/pay/wxpay-v2";

// 分账方 可添加各种微信支付商户号
export async function testAdd() {
  return profitAdd({
    type: "MERCHANT_ID",
    account: "1681606277",
    name: "济南爱希体育发展有限公司",
    relation_type: "SERVICE_PROVIDER",
    sub_mchid: "1700368603",
  });
}

export async function testPartnerAddReceiver1() {
  return partnerAddReceiver({
    type: "MERCHANT_ID",
    account: "1681597204", // 直连商户1661288180 也可以添加
    name: "杭州和风益鸣科技有限公司",
    relation_type: "SERVICE_PROVIDER",
  });
}
export async function testPartnerAddReceiver2() {
  return partnerAddReceiver({
    type: "PERSONAL_OPENID",
    account: "oQq3B6778hZiA0ebmvU4TQiZ9DS8",
    // name: pay.publicEncrypt('张三', certificate.publicKey),
    relation_type: "USER",
  });
}

export async function testPartnerProfit() {
  const data = await parterProfitSharing({
    transaction_id: "4200002305202407254703678314",
    out_order_no: "202407251344552237",
    receivers: [
      {
        type: "MERCHANT_ID",
        account: "1681597204",
        amount: 18,
        description: "test to 1681597204",
      },
      // {
      //   type: "PERSONAL_OPENID",
      //   account: "oQq3B6778hZiA0ebmvU4TQiZ9DS8",
      //   // name: '黄',
      //   amount: 3,
      //   description: "test-to-hqs",
      // },
    ],
  });
  return data;
}
